#include<arpa/inet.h>    //网络相关的库
#include<stdio.h>

int main()
{
    // int a=0x01020304;
    // int b=0x0102;
    // printf("host to network:%x\n",htonl(a));
    // printf("host to network:%x\n",htons(b));
    
    char str[]="192.168.10.1";
    unsigned int a=0;
    inet_pton(AF_INET,str,&a);
    printf("a=%u\n",a);

    unsigned char *p=&a;
    printf("%d %d %d %d\n",*p,*(p+1),*(p+2),*(p+3));

    return 0;
}